unit Graf2u;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TfrmGraf2 = class(TForm)
    gpbGraf1: TGroupBox;
    btnTempYH: TButton;
    btnBaseYH: TButton;
    btnFlowYH: TButton;
    btnTempYV: TButton;
    btnFlowYV: TButton;
    lblHoejre: TLabel;
    lblVenstre: TLabel;
    btnMetYV: TButton;
    btnMetYH: TButton;
    btnIltYV: TButton;
    btnIltYH: TButton;
    btnRPMYV: TButton;
    btnRPMYH: TButton;
    btnRPMJusYV: TButton;
    btnRPMJusYH: TButton;
    btnBaseYV: TButton;
    btnPHYV: TButton;
    btnPHYH: TButton;
    btnSyreYV: TButton;
    btnSyreYH: TButton;
    btnFlowFeedYV: TButton;
    btnFlowFeedYH: TButton;
    procedure btnBaseYHClick(Sender: TObject);
    procedure btnBaseYVClick(Sender: TObject);
    procedure btnTempYVClick(Sender: TObject);
    procedure btnTempYHClick(Sender: TObject);
    procedure btnFlowYVClick(Sender: TObject);
    procedure btnFlowYHClick(Sender: TObject);
    procedure btnMetYVClick(Sender: TObject);
    procedure btnMetYHClick(Sender: TObject);
    procedure btnIltYVClick(Sender: TObject);
    procedure btnIltYHClick(Sender: TObject);
    procedure btnRPMYVClick(Sender: TObject);
    procedure btnRPMYHClick(Sender: TObject);
    procedure btnRPMJusYVClick(Sender: TObject);
    procedure btnRPMJusYHClick(Sender: TObject);
    procedure btnPHYVClick(Sender: TObject);
    procedure btnPHYHClick(Sender: TObject);
    procedure btnSyreYVClick(Sender: TObject);
    procedure btnSyreYHClick(Sender: TObject);
    procedure btnFlowFeedYVClick(Sender: TObject);
    procedure btnFlowFeedYHClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmGraf2: TfrmGraf2;

implementation

uses unit1;

{$R *.dfm}

procedure TfrmGraf2.btnBaseYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[BaseDoseringer]';
if  frmGraf2.btnBaseYH.Caption = 'Base [ON]' then
  begin
    Form1.Chart2.Series[8].Active := false;
    frmGraf2.btnBaseYH.Caption := 'Base [OFF]';
  end
else
  begin
    Form1.Chart2.Series[8].Active := true;
    frmGraf2.btnBaseYH.Caption := 'Base [ON]';
    Form1.Chart2.Series[7].Active := false;
    frmGraf2.btnBaseYV.Caption := 'Base [OFF]';
  end
end;

procedure TfrmGraf2.btnBaseYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[BaseDoseringer]';
if  frmGraf2.btnBaseYV.Caption = 'Base [ON]' then
  begin
    Form1.Chart2.Series[7].Active := false;
    frmGraf2.btnBaseYV.Caption := 'Base [OFF]';
  end
else
  begin
    Form1.Chart2.Series[7].Active := true;
    frmGraf2.btnBaseYV.Caption := 'Base [ON]';
    Form1.Chart2.Series[8].Active := false;
    frmGraf2.btnBaseYH.Caption := 'Base [OFF]';
  end
end;

procedure TfrmGraf2.btnIltYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[Ilt]';
if  frmGraf2.btnIltYV.Caption = 'Ilt [ON]' then
  begin
    Form1.Chart2.Series[11].Active := false;
    frmGraf2.btnIltYV.Caption := 'Ilt [OFF]';
  end
else
  begin
    Form1.Chart2.Series[11].Active := true;
    frmGraf2.btnIltYV.Caption := 'Ilt [ON]';
    Form1.Chart2.Series[12].Active := false;
    frmGraf2.btnIltYH.Caption := 'Ilt [OFF]';
  end
end;

procedure TfrmGraf2.btnTempYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[Temperatur]';
if  frmGraf2.btnTempYH.Caption = 'Temp [ON]' then
  begin
    Form1.Chart2.Series[6].Active := false;
    frmGraf2.btnTempYH.Caption := 'Temp [OFF]';
  end
else
  begin
    Form1.Chart2.Series[6].Active := true;
    frmGraf2.btnTempYH.Caption := 'Temp [ON]';
    Form1.Chart2.Series[5].Active := false;
    frmGraf2.btnTempYV.Caption := 'Temp [OFF]';
  end
end;

procedure TfrmGraf2.btnTempYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[Temperatur]';
if  frmGraf2.btnTempYV.Caption = 'Temp [ON]' then
  begin
    Form1.Chart2.Series[5].Active := false;
    frmGraf2.btnTempYV.Caption := 'Temp [OFF]';
  end
else
  begin
    Form1.Chart2.Series[5].Active := true;
    frmGraf2.btnTempYV.Caption := 'Temp [ON]';
    Form1.Chart2.Series[6].Active := false;
    frmGraf2.btnTempYH.Caption := 'Temp [OFF]';
  end
end;

procedure TfrmGraf2.btnFlowYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[FlowDose]';
if  frmGraf2.btnFlowYV.Caption = 'FlowDose [ON]' then
  begin
    Form1.Chart2.Series[3].Active := false;
    frmGraf2.btnFlowYV.Caption := 'FlowDose [OFF]';
  end
else
  begin
    Form1.Chart2.Series[3].Active := true;
    frmGraf2.btnFlowYV.Caption := 'FlowDose [ON]';

    Form1.Chart2.Series[4].Active := false;
    frmGraf2.btnFlowYH.Caption := 'FlowDose [OFF]';
  end
end;

procedure TfrmGraf2.btnFlowYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[FlowDose]';
if  frmGraf2.btnFlowYH.Caption = 'FlowDose [ON]' then
  begin
    Form1.Chart2.Series[4].Active := false;
    frmGraf2.btnFlowYH.Caption := 'FlowDose [OFF]';
  end
else
  begin
    Form1.Chart2.Series[4].Active := true;
    frmGraf2.btnFlowYH.Caption := 'FlowDose [ON]';
    Form1.Chart2.Series[3].Active := false;
    frmGraf2.btnFlowYV.Caption := 'FlowDose [OFF]';
  end
end;

procedure TfrmGraf2.btnMetYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[MetDose]';
if  frmGraf2.btnMetYV.Caption = 'MetDose [ON]' then
  begin
    Form1.Chart2.Series[9].Active := false;
    frmGraf2.btnMetYV.Caption := 'MetDose [OFF]';
  end
else
  begin
    Form1.Chart2.Series[9].Active := true;
    frmGraf2.btnMetYV.Caption := 'MetDose [ON]';

    Form1.Chart2.Series[10].Active := false;
    frmGraf2.btnMetYH.Caption := 'MetDose [OFF]';
  end
end;

procedure TfrmGraf2.btnMetYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[MetDose]';
if  frmGraf2.btnMetYH.Caption = 'MetDose [ON]' then
  begin
    Form1.Chart2.Series[10].Active := false;
    frmGraf2.btnMetYH.Caption := 'MetDose [OFF]';
  end
else
  begin
    Form1.Chart2.Series[10].Active := true;
    frmGraf2.btnMetYH.Caption := 'MetDose [ON]';
    Form1.Chart2.Series[9].Active := false;
    frmGraf2.btnMetYV.Caption := 'MetDose [OFF]';
  end
end;

procedure TfrmGraf2.btnIltYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[Ilt]';
if  frmGraf2.btnIltYH.Caption = 'Ilt [ON]' then
  begin
    Form1.Chart2.Series[12].Active := false;
    frmGraf2.btnIltYH.Caption := 'Ilt [OFF]';
  end
else
  begin
    Form1.Chart2.Series[12].Active := true;
    frmGraf2.btnIltYH.Caption := 'Ilt [ON]';
    Form1.Chart2.Series[11].Active := false;
    frmGraf2.btnIltYV.Caption := 'Ilt [OFF]';
  end
end;

procedure TfrmGraf2.btnRPMYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[RPM]';
if  frmGraf2.btnRPMYV.Caption = 'RPM [ON]' then
  begin
    Form1.Chart2.Series[15].Active := false;
    frmGraf2.btnRPMYV.Caption := 'RPM [OFF]';
  end
else
  begin
    Form1.Chart2.Series[15].Active := true;
    frmGraf2.btnRPMYV.Caption := 'RPM [ON]';

    Form1.Chart2.Series[16].Active := false;
    frmGraf2.btnRPMYH.Caption := 'RPM [OFF]';
  end
end;

procedure TfrmGraf2.btnRPMYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[RPM]';
if  frmGraf2.btnRPMYH.Caption = 'RPM [ON]' then
  begin
    Form1.Chart2.Series[16].Active := false;
    frmGraf2.btnRPMYH.Caption := 'RPM [OFF]';
  end
else
  begin
    Form1.Chart2.Series[16].Active := true;
    frmGraf2.btnRPMYH.Caption := 'RPM [ON]';

    Form1.Chart2.Series[15].Active := false;
    frmGraf2.btnRPMYV.Caption := 'RPM [OFF]';
  end
end;

procedure TfrmGraf2.btnRPMJusYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[RPMJus]';
if  frmGraf2.btnRPMJusYV.Caption = 'RPMJus [ON]' then
  begin
    Form1.Chart2.Series[13].Active := false;
    frmGraf2.btnRPMJusYV.Caption := 'RPMJus [OFF]';
  end
else
  begin
    Form1.Chart2.Series[13].Active := true;
    frmGraf2.btnRPMJusYV.Caption := 'RPMJus [ON]';

    Form1.Chart2.Series[14].Active := false;
    frmGraf2.btnRPMJusYH.Caption := 'RPMJus [OFF]';
  end
end;

procedure TfrmGraf2.btnRPMJusYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[RPMJus]';
if  frmGraf2.btnRPMJusYH.Caption = 'RPMJus [ON]' then
  begin
    Form1.Chart2.Series[14].Active := false;
    frmGraf2.btnRPMJusYH.Caption := 'RPMJus [OFF]';
  end
else
  begin
    Form1.Chart2.Series[14].Active := true;
    frmGraf2.btnRPMJusYH.Caption := 'RPMJus [ON]';

    Form1.Chart2.Series[13].Active := false;
    frmGraf2.btnRPMJusYV.Caption := 'RPMJus [OFF]';
  end
end;

procedure TfrmGraf2.btnPHYVClick(Sender: TObject);
begin
    Form1.Chart2.LeftAxis.Title.Caption := '[pH]';
if  frmGraf2.btnPHYV.Caption = 'pH [ON]' then
  begin
    Form1.Chart2.Series[1].Active := false;
    frmGraf2.btnPHYV.Caption := 'pH [OFF]';
  end
else
  begin
    Form1.Chart2.Series[1].Active := true;
    frmGraf2.btnPHYV.Caption := 'pH [ON]';
    Form1.Chart2.Series[2].Active := false;
    frmGraf2.btnPHYH.Caption := 'pH [OFF]';
end;
end;

procedure TfrmGraf2.btnPHYHClick(Sender: TObject);
begin
    Form1.Chart2.RightAxis.Title.Caption := '[pH]';
if  frmGraf2.btnPHYH.Caption = 'pH [ON]' then
  begin
    Form1.Chart2.Series[2].Active := false;
    frmGraf2.btnPHYH.Caption := 'pH [OFF]';
  end
else
  begin
    Form1.Chart2.Series[2].Active := true;
    frmGraf2.btnPHYH.Caption := 'pH [ON]';
    Form1.Chart2.Series[1].Active := false;
    frmGraf2.btnPHYV.Caption := 'pH [OFF]';
  end
end;

procedure TfrmGraf2.btnSyreYVClick(Sender: TObject);
begin
  Form1.Chart2.LeftAxis.Title.Caption := '[SyreDoseringer]';
if  frmGraf2.btnSyreYV.Caption = 'Syre [ON]' then
  begin
    Form1.Chart2.Series[17].Active := false;
    frmGraf2.btnSyreYV.Caption := 'Syre [OFF]';
  end
else
  begin
    Form1.Chart2.Series[17].Active := true;
    frmGraf2.btnSyreYV.Caption := 'Syre [ON]';
    Form1.Chart2.Series[18].Active := false;
    frmGraf2.btnSyreYH.Caption := 'Syre [OFF]';
  end
end;

procedure TfrmGraf2.btnSyreYHClick(Sender: TObject);
begin
  Form1.Chart2.RightAxis.Title.Caption := '[SyreDoseringer]';
if  frmGraf2.btnSyreYH.Caption = 'Syre [ON]' then
  begin
    Form1.Chart2.Series[18].Active := false;
    frmGraf2.btnSyreYH.Caption := 'Syre [OFF]';
  end
else
  begin
    Form1.Chart2.Series[18].Active := true;
    frmGraf2.btnSyreYH.Caption := 'Syre [ON]';
    Form1.Chart2.Series[17].Active := false;
    frmGraf2.btnSyreYV.Caption := 'Syre [OFF]';
  end
end;

procedure TfrmGraf2.btnFlowFeedYVClick(Sender: TObject);
begin
   Form1.Chart2.LeftAxis.Title.Caption := '[FlowFeed]';
if  frmGraf2.btnFlowFeedYV.Caption = 'FlowFeed [ON]' then
  begin
    Form1.Chart2.Series[19].Active := false;
    frmGraf2.btnFlowFeedYV.Caption := 'FlowFeed [OFF]';
  end
else
  begin
    Form1.Chart2.Series[19].Active := true;
    frmGraf2.btnFlowFeedYV.Caption := 'FlowFeed [ON]';
    Form1.Chart2.Series[20].Active := false;
    frmGraf2.btnFlowFeedYH.Caption := 'FlowFeed [OFF]';
  end
end;

procedure TfrmGraf2.btnFlowFeedYHClick(Sender: TObject);
begin
  Form1.Chart2.RightAxis.Title.Caption := '[FlowFeed]';
if  frmGraf2.btnFlowFeedYH.Caption = 'FlowFeed [ON]' then
  begin
    Form1.Chart2.Series[20].Active := false;
    frmGraf2.btnFlowFeedYH.Caption := 'FlowFeed [OFF]';
  end
else
  begin
    Form1.Chart2.Series[20].Active := true;
    frmGraf2.btnFlowFeedYH.Caption := 'FlowFeed [ON]';
    Form1.Chart2.Series[19].Active := false;
    frmGraf2.btnFlowFeedYV.Caption := 'FlowFeed [OFF]';
  end
end;

end.
